#！/user/bin/env python3
# _*_ coding:utf-8  _*_
import math


def my_abs(x):
    if not isinstance(x,(int,float)):
        raise TypeError('bad operand type')
    if x >= 0:
        return x
    else:
        return -x

def move(x,y,step,angle=0):
    nx=x + step*math.cos(angle)
    ny=y - step*math.sin(angle)
    return nx,ny

def quadratic(a,b,c):
    if not isinstance(a,(int,float)):
        raise TypeError('bad operand type')
    if not isinstance(b,(int,float)):
        raise TypeError('bad operand type')
    if not isinstance(b,(int,float)):
        raise TypeError('bad operand type')
    tmp=b*b-4*a*c
    if tmp<0:
        return -1
    elif tmp==0:
        return -b/(2*a)
    else:
        d = math.sqrt(tmp)
        x1 = (-b + d) / (2 * a)
        x2 = (-b - d) / (2 * a)
        return x1, x2

def fact(n):
    if n==1:
        return 1
    return n* fact(n-1)